<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue.js基础</title>
</head>

<body>
    <!-- 视图区域 -->
    <div id="app">
        {{a}}
    </div>
    <script src="../lib/vue.js"></script>
    <script>
        let data = { a: 1 };
        // 创建vue实例 （vm视图模型）

        let vm = new Vue({
            el: "#app",
            data: data,
            methods: {
            }
        })
        // console.log(vm.a==data.a);//true
        // data.a="hahahha";
       
        vm.$watch('a', function (newVal, oldVal) {
            console.log(newVal, oldVal);

        })
        vm.$data.a = "test...."
    </script>
</body>

</html>